using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace org.ngwt.user.server.rpc
{
    public class RPCRequest
    {
        /**
         * The method for this request.
         */
        private MethodInfo method;

        /**
         * The parameters for this request.
         */
        private Object[] parameters;


        /**
         * {@link SerializationPolicy} used for decoding this request and for encoding
         * the responses.
         */
        private SerializationPolicy serializationPolicy;

        /**
         * Construct an RPCRequest.
         */
        public RPCRequest(MethodInfo method, Object[] parameters,
            SerializationPolicy serializationPolicy)
        {
            this.method = method;
            this.parameters = parameters;
            this.serializationPolicy = serializationPolicy;
        }

        /**
         * Get the request's method.
         */
        public MethodInfo Method
        {
            get { return method; }
        }
        /**
         * Get the request's parameters.
         */
        public Object[] Parameters
        {
            get { return parameters; }
        }

        /**
         * Returns the {@link SerializationPolicy} used to decode this request. This
         * is also the <code>SerializationPolicy</code> that should be used to
         * encode responses.
         * 
         * @return {@link SerializationPolicy} used to decode this request
         */
        public SerializationPolicy getSerializationPolicy()
        {
            return serializationPolicy;
        }




    }
}
